﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DeliveryApply.aspx.cs" Inherits="Delivery_DeliveryApply" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>DeliveryAplly</title>
    <link href="../CSS/delivery.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Scripts/jquery-1.4.1-vsdoc.js" defer="defer"></script>
    <script language="javascript" type="text/javascript" src="Jscript/Delivery.js"></script>
</head>
<body onload="setWidth();">
    <form id="form1" method="post" runat="server" enctype="multipart/form-data" accept="image/*">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Services><asp:ServiceReference Path="~/webservice/DeliveryApplyWebService.asmx" /></Services>
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdHead" runat="server">
       <ContentTemplate>
        <table cellpadding="0" cellspacing="0" class="topTable">
            <tr>
                <td class="topTd">
                    <asp:Label ID="lblLocation" runat="server" Text="<%$ Resources:language, Location %>"></asp:Label>
                    <img alt="当前位置" src="../Image/weizhi.gif" />>><asp:Label ID="Label1" runat="server" Text="发货申请"></asp:Label>
                    <asp:Label ID="Label2" runat="server" Text="<%$ Resources:language, Must1 %>"></asp:Label>
                    <span style="color:#ff0000">*</span><asp:Label ID="Label3" runat="server" Text="<%$ Resources:language, Must2 %>"></asp:Label>
                </td>
            </tr>
        </table>  <div id="covertDiv" class="transp" style="display:none;"></div> 
    <fieldset>
        <legend><span style="font-size: 12px;">
            <asp:Label ID="lblLegend1" runat="server" Text="操作"></asp:Label></span></legend>        
                    <table cellpadding="0" cellspacing="0" class="topHeadTable">                       
                        <tr><td colspan="8" class="trHeadFoot"></td></tr>
                        <tr>
                            <td class="td10" colspan="2">
                                <asp:Label ID="Label10" runat="server" Text="客户名称:"></asp:Label>
                            </td>
                            <td class="td20">
                                <asp:TextBox ID="txtCustomer" runat="server" CssClass="txtStyleD"></asp:TextBox>
                                <asp:DropDownList ID="ddlCustomer" runat="server" AutoPostBack="true"
                                 onblur="showHidden('ddlCustomer','ddlCustomer', 'txtCustomer','imgCustomer')" 
                                    CssClass="ddl" onselectedindexchanged="ddlCustomer_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            <td class="td5left">
                                <img alt="" runat="server" src="../Image/ddl.jpg" id="imgCustomer"
                                 onmouseover="showHidden(this.id,'txtCustomer','ddlCustomer','ddlCustomer')" />
                            </td>
                            <td class="td10">
                                <asp:Label ID="Label5" runat="server" Text="销售员:"></asp:Label>
                            </td>
                            <td class="td20">
                                <asp:TextBox ID="txtSaleName" runat="server" CssClass="txtStyleD"></asp:TextBox>
                                <asp:DropDownList ID="ddlSaleName" runat="server" AutoPostBack="true" 
                                onblur="showHidden('ddlSaleName','ddlSaleName', 'txtSaleName', 'imgSaleName')" 
                                    CssClass="ddl" onselectedindexchanged="ddlSaleName_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            <td class="td5left">
                                <img alt="" runat="server" src="../Image/ddl.jpg" id="imgSaleName"
                                 onmouseover="showHidden(this.id,'txtSaleName','ddlSaleName','ddlSaleName')" />
                            </td>
                            <td class="td20">
                            </td>
                        </tr>
                        <tr><td colspan="8" class="trSeparate"></td></tr>
                        <tr>
                            <td class="td10" colspan="2">
                                <asp:Label ID="Label7" runat="server" Text="合同号(ITT):"></asp:Label>
                            </td>
                            <td class="td20">
                                <asp:TextBox ID="txtContractNo" runat="server" CssClass="txtStyle"></asp:TextBox>
                                <asp:DropDownList ID="ddlContractNo" runat="server" AutoPostBack="true" 
                                onblur="showHidden('ddlContractNo','ddlContractNo', 'txtContractNo','imgContractNo')"
                                    CssClass="ddl" onselectedindexchanged="ddlContractNo_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            <td class="td5left">
                                <img ID="imgContractNo" runat="server" alt="" 
                                    onmouseover="showHidden(this.id,'txtContractNo','ddlContractNo','ddlContractNo')" 
                                    src="../Image/ddl.jpg" />
                            </td>
                            <td class="td10">
                                <asp:Label ID="Label9" runat="server" Text=" SO#  "></asp:Label>
                            </td>
                            <td class="td20">
                                <asp:TextBox ID="txtSoNo" runat="server" CssClass="txtStyle"></asp:TextBox>
                                <asp:DropDownList ID="ddlSoNo" runat="server" AutoPostBack="true" 
                                 onblur="showHidden('ddlSoNo','ddlSoNo', 'txtSoNo', 'imgSoNo')"
                                    CssClass="ddl" onselectedindexchanged="ddlSoNo_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            <td class="td5left">
                                <img ID="imgSoNo" runat="server" alt="" 
                                    onmouseover="showHidden(this.id,'txtSoNo','ddlSoNo','ddlSoNo')" 
                                    src="../Image/ddl.jpg" />
                            </td>
                            <td class="td20">
                            </td>
                        </tr>   
                        <tr><td colspan="8" class="trSeparate"></td></tr>
                        <tr>
                            <td class="td10" colspan="2">
                                <asp:Label ID="Label11" runat="server" Text="合同号(Customer):"></asp:Label>
                            </td>
                            <td class="td20">
                                <asp:TextBox ID="txtContractNoCustomer" runat="server" CssClass="txtStyle"></asp:TextBox>
                                <asp:DropDownList ID="ddlContractNoCustomer" runat="server" AutoPostBack="true" 
                                onblur="showHidden('ddlContractNoCustomer','ddlContractNoCustomer', 'txtContractNoCustomer','imgContractNoCustomer')"
                                    CssClass="ddl" ontextchanged="ddlContractNoCustomer_TextChanged" >
                                </asp:DropDownList>
                            </td>
                            <td class="td5left">
                                <img ID="imgContractNoCustomer" runat="server" alt="" 
                                    onmouseover="showHidden(this.id,'txtContractNoCustomer','ddlContractNoCustomer','ddlContractNoCustomer')" 
                                    src="../Image/ddl.jpg" />
                            </td>
                            <td class="td10">
                                <asp:Label ID="Label88" runat="server" Text="已审批金额:"></asp:Label>
                              </td>
                            <td class="td20">
                                <asp:TextBox ID="txtApprovedAmout" runat="server" BackColor="#F6F6F6" 
                                    CssClass="txtStyleD" Enabled="False">0</asp:TextBox>
                              </td>
                            <td class="td5left">
                                </td>
                            <td class="td20">
                            </td>
                        </tr>   
                        <tr><td colspan="8" class="trSeparate"></td></tr>                    
                        <tr>
                            <td class="td10" colspan="2">
                                <asp:Label ID="Label86" runat="server" Text="等待审批金额:"></asp:Label>
                            </td>
                            <td class="td20">
                                <asp:TextBox ID="txtApprovalAmount" runat="server" BackColor="#F6F6F6" 
                                    CssClass="txtStyleD" Enabled="False">0</asp:TextBox>
                            </td>
                            <td class="td5left">
                                </td>
                            <td class="td10">
                                <asp:Label ID="Label87" runat="server" Text="已选总金额:"></asp:Label>
                            </td>
                            <td class="td20">
                                <asp:TextBox ID="txtApprovalSelectedAmount" runat="server" BackColor="#F6F6F6" 
                                    CssClass="txtStyleD" Enabled="False" ForeColor="White">0</asp:TextBox>
                            </td>
                            <td class="td5left">
                                </td>
                            <td class="td20">
                                <asp:Label ID="lblTradingAllAmount" runat="server" Text="合同总金额: "></asp:Label>
                            </td>
                        </tr>
                        <tr><td colspan="8" class="trSeparate"></td></tr>
                        <tr>
                            <td class="td10" colspan="2">
                                <asp:Label ID="Label89" runat="server" Text="备注:"></asp:Label>
                            </td>
                            <td class="td20" colspan="4">
                                <asp:TextBox ID="txtRemark" runat="server" CssClass="txtStyleD" 
                                    MaxLength="200"></asp:TextBox>
                                </td>
                            <td class="td5left">
                                </td>
                            <td class="td20">
                                </td>
                        </tr>
                        <tr><td colspan="8" class="trSeparate"></td></tr>
                        <tr>
                            <td class="td10" colspan="2">
                                <asp:Label ID="Label13" runat="server" Text="附件:"></asp:Label>
                            </td>
                            <td class="td20" style="height:23px" colspan="6">
                               <iframe id="DeliveryApplyFileUploadWeb" src="DeliveryApplyFileUpload.aspx" frameborder="0" scrolling="no" width="100%" height="100%"></iframe>
                            </td>
                        </tr>
                        <tr><td colspan="8" class="trHeadFoot"></td></tr>
                       </table>
        <div class="cmdButtonsDiv"> 
        <asp:Button ID="cmdQuery" runat="server" CssClass="cmdStyle" 
                        onclick="cmdQuery_Click" Text="查询" />
            &nbsp;<input id="cmdSubmit" type="button" onclick="TradingMaterielApportion()" runat="server"
                value="提交" class="cmdStyle" />
            &nbsp;<input id="Button1" type="button" onclick="TradingMaterielApportion();TradingDeliveryApply()" runat="server"
                value="物料分摊" class="cmdStyle" style="display:none;" />
                <input id="txtApplyAmount" type="text" class="txtStyleUnitPrice" value="0" runat="server" /></div></fieldset>
            </ContentTemplate></asp:UpdatePanel>   
            <asp:UpdateProgress ID="UpdateProgress1" runat="server">    
    <ProgressTemplate><span style="font-size:16px; color:Blue;">Data Loading..... </span>             
    </ProgressTemplate>
    </asp:UpdateProgress>   
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
       <ContentTemplate>
        <fieldset style="width:99%; text-align:center;">
            <legend><span style="font-size: 12px;">
                <asp:Label ID="lblLegend2" runat="server" Text="列表"></asp:Label></span></legend>
            <div  class="detailDiv" id="detailDiv" style="overflow-y: auto; overflow-x: scroll;">
                <%= getTrading()%> 
             </div>
             <div  style="text-align:left;">
                            <table>
                                <tr>
                                    <td>
                                        <asp:Label ID="Label85" runat="server" Text="每页显示数据"></asp:Label>
                                        <asp:DropDownList ID="ddlPageSize" runat="server" Width="68px" 
                                            AutoPostBack="True" 
                                            onselectedindexchanged="ddlPageSize_SelectedIndexChanged" Height="16px">
                                        <asp:ListItem Value="1000" Selected="True"></asp:ListItem>
                                        <asp:ListItem Value="15" Text="15"></asp:ListItem>
                                        <asp:ListItem Value="20" Text="20"></asp:ListItem>
                                        <asp:ListItem Value="25" Text="25"></asp:ListItem>
                                        <asp:ListItem Value="30" Text="30"></asp:ListItem>
                                        <asp:ListItem Value="40" Text="40"></asp:ListItem>
                                        <asp:ListItem Value="50" Text="50"></asp:ListItem>
                                        <asp:ListItem Value="60" Text="60"></asp:ListItem>
                                        <asp:ListItem Value="70" Text="70"></asp:ListItem>
                                        <asp:ListItem Value="80" Text="80"></asp:ListItem>
                                        <asp:ListItem Value="90" Text="90"></asp:ListItem>
                                        <asp:ListItem Value="100" Text="100"></asp:ListItem>
                                        <asp:ListItem Value="110" Text="110"></asp:ListItem>
                                        <asp:ListItem Value="120" Text="120"></asp:ListItem>
                                        <asp:ListItem Value="130" Text="130"></asp:ListItem>
                                        <asp:ListItem Value="140" Text="140"></asp:ListItem>
                                        <asp:ListItem Value="150" Text="150"></asp:ListItem>
                                        <asp:ListItem Value="160" Text="160"></asp:ListItem>
                                        <asp:ListItem Value="170" Text="170"></asp:ListItem>
                                        <asp:ListItem Value="180" Text="180"></asp:ListItem>
                                        <asp:ListItem Value="190" Text="190"></asp:ListItem>
                                        <asp:ListItem Value="200" Text="200"></asp:ListItem>
                                        </asp:DropDownList>                                         
                                        <asp:Label ID="lblTotal0" runat="server" Text="<%$ Resources:UserSqlPage, Total1 %>"></asp:Label>
                                        <asp:Label ID="lblTotal" runat="server"></asp:Label>

                                        <asp:Label ID="Total2" runat="server" Text="<%$ Resources:UserSqlPage, Total2 %>"></asp:Label>,
                                        <asp:Label ID="Label4" runat="server" Text="<%$ Resources:UserSqlPage, CurrentPage1 %>"></asp:Label>
                                        <asp:Label ID="lblPageIndex" runat="server" Text='1'></asp:Label>
                                        <asp:Label ID="Label6" runat="server" Text="<%$ Resources:UserSqlPage, CurrentPage2 %>"></asp:Label>,
                                        <asp:Label ID="Label8" runat="server" Text="<%$ Resources:UserSqlPage, TotalPage1 %>"></asp:Label>
                                        <asp:Label ID="lblPageCount" runat="server" Text='1'></asp:Label>
                                        <asp:Label ID="Label12" runat="server" Text="<%$ Resources:UserSqlPage, TotalPage2 %>"></asp:Label>
                                        <% //首页/上一页 %>
                                        <asp:LinkButton ID="lbtFirstPage" runat="server" Enabled="false" 
                                            Text="<%$ Resources:UserSqlPage, FirstPage %>" onclick="lbtFirstPage_Click" />&nbsp;
                                        <asp:LinkButton ID="lbtPreviousPage" runat="server" Enabled="false" 
                                            Text="<%$ Resources:UserSqlPage, PreviousPage %>" 
                                            onclick="lbtPreviousPage_Click" />&nbsp;
                                        
                                        <% //下一页/尾页 %>
                                        <asp:LinkButton ID="lbtNextPage" runat="server" Enabled="false" 
                                            Text="<%$ Resources:UserSqlPage, NextPage %>" onclick="lbtNextPage_Click" />&nbsp;
                                        <asp:LinkButton ID="lbtLastPage" runat="server" Enabled="false" 
                                            Text="<%$ Resources:UserSqlPage, LastPage %>" onclick="lbtLastPage_Click" />                                        
                                        <input type="text" id="txtNewPageIndex" runat="server" value="" onblur="checkNumMax(txtIsNumber(this.id))" style="width:25px" />
                                        <asp:LinkButton ID="btnGo" runat="server" Text="<%$ Resources:UserSqlPage, PageGo %>" onclick="btnGo_Click"></asp:LinkButton>
                                            <script language="javascript" type="text/javascript">
                                                function checkNumMax(flag) {
                                                    if (flag) {
                                                        var aa = document.getElementById('txtNewPageIndex').value;
                                                        var bb = $get("lblPageCount").innerHTML.toString();
                                                        if ((bb < aa)) {
                                                            document.getElementById('txtNewPageIndex').value = bb;
                                                            window.alert("Not that Page！");
                                                        }
                                                    }
                                                }
                                            </script>
                                    </td>
                                </tr>
                            </table>
                   </div>      
             <script language="javascript" type="text/javascript">
                        function checkSelectedQTYForShippment(str, strID) {
                        }
                        //文本框输入只能为非负数
                        function txtIsNumber(txtID) {
                            var a = document.getElementById(txtID).value;
                            
//                            if (!(Math.abs(a) == a) || a == "") {
                               if(window.isNaN(a)){
                                alert("只能是数字！");
                                document.getElementById(txtID).value = "0";
                                document.getElementById(txtID).focus();
                                return false;
                            }
                            else
                            { return true; }
                        }
                        function Text1_onclick() {

                        }

             </script>          
        </fieldset>  
        </ContentTemplate></asp:UpdatePanel>                   
    </form>
    <input id="txtUserCode" type="text" disabled="disabled" runat="server" style="display:none;" />
    <input id="txtCoCode" type="text" runat="server" style="display:none;" />
</body>
</html>
